#include <header.h>

int main(){
    // mkdir("test/zs", 0777);



    //int file_fd = open("./test/zs/1.txt", O_RDONLY);
    //int file_fd = open("./test/zs/1.txt", O_WRONLY);
    //write(file_fd, "ab", 2);


    int file1 = open("./test/1.txt", O_RDWR); 
    int file2 = open("./test/zs/1.txt", O_RDWR| O_CREAT, 0666);


    char buf[4096] = {0};
    // read(file1, buf, sizeof(buf));
    // write(file2, buf, strlen(buf));

    ssize_t read_size = read(file1, buf, sizeof(buf));
    // 返回值: 记录这次读取数据, 真正读取到的数据个数

    write(file2, buf, read_size);

    close(file1);
    close(file2);
    return 0;
}

